#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int commonFactors(int a, int b) 
{
	int i = a < b ? a : b;
	int count = 0;
	for (i; i >= 1; i--)
	{
		if (a % i == 0 && b % i == 0)
			count++;
	}
	return count;
}
int main()
{
	printf("%d",commonFactors(12, 6));

	return 0;
}